package com.yunlong.util;

import com.yunlong.form.UserRegisterForm;

import java.util.ArrayList;
import java.util.List;

/**
 * @author guorui
 * @date 2022-01-13 10:29
 */
public class ListCastObject {
    public static List<UserRegisterForm> getUsers(List usersList){
        List<UserRegisterForm> userRegisterForms = new ArrayList<>();
        for(int i=1;i<usersList.size();i++){
            ArrayList userList = (ArrayList) usersList.get(i);
            String userId = (String) userList.get(0);
            String userName = (String) userList.get(1);
            String userGender = (String) userList.get(2);
            String userDirection = (String) userList.get(3);
            String userEmail = (String) userList.get(4);
            String userPassword = (String) userList.get(5);
            String startYear = (String) userList.get(6);
            UserRegisterForm user = new UserRegisterForm(userId,userName,userGender,userDirection,userEmail,userPassword,startYear);
            userRegisterForms.add(user);
        }
        return userRegisterForms;
    }

}
